//
//  WalletTableViewCell.m
//  路人侠
//
//  Created by 王涛 on 16/4/23.
//  Copyright © 2016年 zhangxulong. All rights reserved.
//

#import "WalletTableViewCell.h"

@implementation WalletTableViewCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{

    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        _dateLabel = [[UILabel alloc]init];
        _moneyLabel = [[UILabel alloc]init];
        _detailLabel = [[UILabel alloc]init];
        _imageView = [[UIImageView alloc]init];
        
        
        
        [self.contentView addSubview:_dateLabel];
        [self.contentView addSubview:_moneyLabel];
        [self.contentView addSubview:_detailLabel];
        [self.contentView addSubview:_imageView];
        
        
    }
    
    return self;

}
-(void)layoutSubviews{
    
    
    
    [super layoutSubviews];
    
    _dateLabel.frame = CGRectMake(54*wScale,58*hScale,55*wScale, 20 * hScale);
    _dateLabel.text = _date;
    _dateLabel.textAlignment = NSTextAlignmentCenter;
    _dateLabel.font = [UIFont systemFontOfSize:20 * hScale];
    
    
    _imageView.frame = CGRectMake(CGRectGetMaxX(_dateLabel.frame) + 48 * wScale, 36 * hScale, 59 * wScale, 59 * hScale);
    _imageView.image = [UIImage imageNamed:_image];
    _imageView.layer.masksToBounds = YES;
    _imageView.layer.cornerRadius = _imageView.frame.size.width * 0.5;
   
    
    _moneyLabel.frame = CGRectMake(CGRectGetMaxX(_imageView.frame) + 60 * wScale,38 * hScale,140 * wScale, 21 * hScale);
    _moneyLabel.text = _money;
    _moneyLabel.font = [UIFont systemFontOfSize:28 * hScale];
    
    
    _detailLabel.frame = CGRectMake(CGRectGetMaxX(_imageView.frame) +60 * wScale,74 * hScale,250 * wScale, 19 * hScale);
    _detailLabel.text = _detail;
    _detailLabel.font = [UIFont systemFontOfSize:20 * hScale];
    _detailLabel.textColor = [UIColor colorWithRed:100/255.0f green:100/255.0f blue:100/255.0f alpha:1.0];
}


@end
